﻿/*
 * This software is the confidential and proprietary
 * information of NetBay
 * Such confidential information should not be disclosed
 * NetBay copyright(c) 2010
 */

#region Using
using System;

#endregion

namespace NetBay.Core.Extensions
{
    public static class StringEx
    {
        // for interface IEnumerable
        public static string AlphaQuoted(this string p_szSource)
        {
            if (p_szSource == null)
                throw new ArgumentException("Parameter source can not be null.");

            long l_iOut;
            if (long.TryParse(p_szSource, out l_iOut) == false)
            {
                p_szSource = "'" + p_szSource.TrimStart(new[] { '\'' }).TrimEnd(new[] { '\'' }) + "'";
            }

            return p_szSource;
        }
    }
}
